<template>
  <view class="send">
    <view class="changeView">
      <text class="changeTitle">
        批量激活
      </text>
      <view class="changeBtn" @click="handleScan">
        扫码激活
      </view>
    </view>
    <view class="cardItem">
      <view>
        <view class="title">请输入起始卡券号段</view>
        <view class="uni-input-wrapper">
          <input class="uni-input" placeholder="请输入" />
          <uni-icons type="scan" size="26" class="scanIcon" @click="scan"></uni-icons>
        </view>
      </view>
      <view>
        <view class="title">数量</view>
        <view class="uni-input-wrapper">
          <input class="uni-input" password placeholder="请输入" />
          <uni-icons type="scan" size="26" class="scanIcon" @click="scan"></uni-icons>
        </view>
      </view>
      <view class="cardButton">
        <view class="btn" @click="handleChange">提交</view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      count: 1
    };
  },
  methods: {
    handleScan() {
      uni.switchTab({
        url: '/pages/scan/scanActive/scanActive'
      });
    },
    scan() {
      // 调用扫码功能
      uni.scanCode({
        success: (res) => {
          console.log('扫码成功:', res);
          this.result = res.result; // 获取扫码结果
        },
        fail: (err) => {
          console.log('扫码失败:', err);
          uni.showToast({
            title: '扫码失败',
            icon: 'none'
          });
        }
      });
    },
    handleChange() {
      uni.navigateTo({
        url: '/pages/card/change/change'
      });
    }
  },
  computed: {

  },
  watch: {

  },
  // 页面周期函数--监听页面加载
  onLoad() {
  },
  // 页面周期函数--监听页面初次渲染完成
  onReady() {},
  // 页面周期函数--监听页面显示
  onShow() {},
  // 页面周期函数--监听页面隐藏
  onHide() {},
  // 页面周期函数--监听页面卸载
  onUnload() {},
  // 页面处理函数--监听用户下拉动作
  onPullDownRefresh() {},
  // 页面上拉触底事件的处理函数
  onReachBottom() {},
  // 用户点击右上角分享
  onShareAppMessage() {},
  // 页面处理函数--监听页面滚动(not-nvue)
  onPageScroll(e) {}
};
</script>

<style lang="scss" scoped>
@import "./index.scss";
</style>
